package com.sunny.hp.common.pdf;

import java.io.IOException;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Font;
import com.itextpdf.text.FontFactoryImp;
import com.itextpdf.text.pdf.BaseFont;

/**
 * ******************************************************************************
 * <PRE> * PDF Font *
 * 1. Project	: BEMS2.1
 * 2. Package	: com.ntels.bems.common.pdf
 * 3. FileName	: DefaultFontProvider.java
 * 4. 작성자		: P045701
 * 5. 작성일		: 2014. 4. 1. 오후 2:14:55
 * 6. 설명		:
 * </PRE>
 *******************************************************************************
 */
public class DefaultFontProvider extends FontFactoryImp {
	 private String _default;
	 
	 public DefaultFontProvider(String def) {
		 _default = def;
	 }
	 public Font getFont(String fontname,String encoding, boolean embedded, float size,int style, BaseColor color) {
		 try {
			 return new Font(BaseFont.createFont(_default, BaseFont.IDENTITY_H, BaseFont.EMBEDDED), 9, style, BaseColor.BLACK);
		 } catch (DocumentException e) {
			 e.printStackTrace();
		 } catch (IOException e) {
			 e.printStackTrace();
		 }
		 return null;
	 }

}
